From e9b17614325b06629f7460a2a7ca09b4858d5cd7 Mon Sep 17 00:00:00 2001 From: "awilliam@xenbuild.aw" Date: Wed, 14 Jun 2006 16:05:45 -0600 Subject: [PATCH] [IA64] let VMM do itc sync for guest on VTI domain Previously, on SMP VTI-domain, Guest OS was responsible for syncing itc by calling ia64_sync_itc, but the round trip may be very large on VTI domain, that may cause guest itcs are not synced well and cause guest wall clock is not accurate. This patch intends to fix this issue, when guest wants to sync itc( vcpus other than vcpu0 write itc), VMM directly get vcpu0 itc for other vcpus. Signed-off-by: Anthony Xu --- xen/arch/ia64/vmx/vlsapic.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/xen/arch/ia64/vmx/vlsapic.c b/xen/arch/ia64/vmx/vlsapic.c index d519cdafa0..dab483a8a0 100644 --- a/xen/arch/ia64/vmx/vlsapic.c +++ b/xen/arch/ia64/vmx/vlsapic.c @@ -140,8 +140,6 @@ uint64_t vtm_get_itc(VCPU *vcpu) } - - void vtm_set_itc(VCPU *vcpu, uint64_t new_itc) { uint64_t vitm, vitv; @@ -149,8 +147,15 @@ void vtm_set_itc(VCPU *vcpu, uint64_t new_itc) vitm = VCPU(vcpu,itm); vitv = VCPU(vcpu,itv); vtm=&(vcpu->arch.arch_vmx.vtm); - vtm->vtm_offset = new_itc - ia64_get_itc(); - vtm->last_itc = new_itc; + if(vcpu->vcpu_id == 0){ + vtm->vtm_offset = new_itc - ia64_get_itc(); + vtm->last_itc = new_itc; + } + else{ + vtm->vtm_offset = vcpu->domain->vcpu[0]->arch.arch_vmx.vtm.vtm_offset; + new_itc=vtm->vtm_offset + ia64_get_itc(); + vtm->last_itc = new_itc; + } if(vitm < new_itc){ clear_bit(ITV_VECTOR(vitv), &VCPU(vcpu, irr[0])); stop_timer(&vtm->vtm_timer); -- 2.30.2